<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib  prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="redis" uri="http://www.shopjsp.com/redisTag/functions" %>
<c:set var="basePath" value="${redis:getSysConfig('base_path_back')}"/>
<c:set var="srcPath" value="${redis:getSysConfig('sysFileVisitRoot_back')}"/>
<script type="text/javascript">
    /**
     * 查看商品属性详情
     */
    function detailInfo(id){
        $(".sxv").remove();
        $.ajax({
            type: "POST",
            dataType: "JSON",
            url: "${basePath}/back/productAttribute/getProductAttributeInfo.sjson",
            data: {productAttrId:id},
            success: function(result){
                var data = JSON.parse(result.data);
                /**重置详情页中所有html展示信息**/
                resetDetailTable("sxv");
                /**设置展示信息**/
                var shopProductType =data.shopProductType;
                $("#d_productTypeName").html(shopProductType.sortName);
                var productAttr =data.shopProductAttribute;
                $("#d_name").html(productAttr.name);
                $("#d_sort").html(productAttr.sort);
                if(productAttr.isListShow=="0"){
                    $("#d_isListShow").html("<font class='color_002'>未显示</font>");
                }else{
                    $("#d_isListShow").html("<font class='color_001'>已显示</font>");
                }
                $(".d_addAttrValue").remove();
                var attributeValueList = data.attributeValueList;
                if(attributeValueList!=null){
                    var html = "<tr class='d_addAttrValue'><td class='titlebg' colspan='2' align='center' style='font-weight:bold;'>排序号</td><td class='titlebg' colspan='2' align='center' style='font-weight:bold;' >属性值名称</td></tr>";
                    for(var i=0;i<attributeValueList.length;i++){
                        html += "<tr class='d_addAttrValue'>";
                        html += "<td colspan='2' align='center'>"+attributeValueList[i].sort+"</td><td colspan='2' align='center'>"+attributeValueList[i].attrValueName+"</td>";
                        html += "</tr>";
                    }
                    $("#sxv").append(html);
                }

            }
        });
    }

</script>

<!--详情模态框（Modal） -->
<div class="modal fade" id="detailModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" >
    <div class="modal-dialog" style="width:70%">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h5 class="modal-title" id="myModalLabel">商品属性详情</h5>
            </div>
            <div class="modal-body">
                <table id="sxv" align="center" class="addOrEditTable table table-bordered" style="width:100%;">
                    <tr>
                        <td colspan="4" class="titlebg" style="font-weight:bold;text-align: center;">属性信息</td>
                    </tr>
                    <tr>
                        <td class="toright_td" style="width: 25%;">所属分类：</td>
                        <td class="toleft_td" style="width: 25%;">
                            <span id="d_productTypeName"></span>
                        </td>
                        <td class="toright_td" style="width: 25%;">属性名称：</td>
                        <td class="toleft_td" style="width: 25%;">
                            <span id="d_name"></span>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="1" class="toright_td">排序号：</td>
                        <td colspan="3" class="toleft_td">
                            <span id="d_sort"></span>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="1" class="toright_td">是否显示：</td>
                        <td colspan="3" class="toleft_td">
                            <span id="d_isListShow"></span>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" class="titlebg" style="font-weight:bold;text-align: center;">属性值信息</td>
                    </tr>

                </table>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>